package com.starhub.api.docwriting.result;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.starhub.api.docwriting.vo.WritingRecordVO;

import lombok.Data;

/**   
 * 写作记录列表结果
 * @version: V1.0
 * @author: liuhf
 * @time 2025-05-18
 */
@Data
public class WritingRecordListResult {
    private Page<WritingRecordVO> recordPage;
    private int total;
    private String message;
    private boolean success;

    public static WritingRecordListResult fail(String message) {
        WritingRecordListResult result = new WritingRecordListResult();
        result.setSuccess(false);
        result.setMessage(message);
        return result;
    }

    public static WritingRecordListResult success(Page<WritingRecordVO> recordPage, int total) {
        WritingRecordListResult result = new WritingRecordListResult();
        result.setTotal(total);
        result.setRecordPage(recordPage);
        result.setSuccess(true);
        return result;
    }
} 